package listener;

import characters.main.Bee;
import mapelements.foreground.Foreground;
import mapelements.foreground.ForegroundEventDispatcher;
import mapelements.foreground.ForegroundListener;

public class BeeDispatcher extends ForegroundEventDispatcher{

	@Override
	public void fireForegroundEvent(Foreground source, int action) {
		super.fireForegroundEvent(source, action);
		if (action==BeeEvent.LIFECHANGED){
			for (ForegroundListener l: this.getListeners()){
				try{
					((BeeListener)l).lifeChanged(new BeeEvent((Bee)source,action));
				}catch (ClassCastException error){}
			}
		}
	}

	
}
